package com.pap.product.item.controller;

import java.util.List;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.pap.base.controller.BaseController;
import com.pap.obj.vo.response.ResponseVO;
import com.pap.product.agent.item.IItemAgent;
import com.pap.product.agent.item.dto.ItemCheckDTO;
import com.pap.product.item.auto.entity.Item;

@RestController
@RequestMapping("/v1/product/item")
public class ItemController extends BaseController<Item, IItemAgent> {

	private static Logger logger  =  LoggerFactory.getLogger(ItemController.class);
	
	@Resource(name = "itemAgent")
	@Override
	public void setService(IItemAgent agent) {
		super.service = agent;
	}
	
	@SuppressWarnings("unchecked")
	@RequestMapping(value = "/selectallitemforshow")
	public ResponseVO<ItemCheckDTO> selectAllItemForShow(@RequestHeader(value = "clientLicenseId", defaultValue = "-1") String clientLicenseId,
			@RequestHeader(value = "loginUserId", defaultValue = "-1") String loginUserId) {
		List<ItemCheckDTO> list = service.selectItemTypeAndValueTypeForList(clientLicenseId);
		return ResponseVO.successdatas(list, null);
	}
	
}
